package com.easy.dn.ui.main.presenter;

import com.easy.common.baserx.RxSubscriber;
import com.easy.dn.bean.SearchResumeBean;
import com.easy.dn.ui.main.contract.SearchResumeContract;

import java.util.Map;

/**
 * Created by 丁宁
 * on 2017/7/31.
 */

public class SearchResumePresenter extends SearchResumeContract.Presenter {

    @Override
    public void getData(Map<String , String> map) {
        mRxManage.add(mModel.getResumeList(map).subscribe(new RxSubscriber<SearchResumeBean>(mContext,true) {

            @Override
            protected void _onNext(SearchResumeBean searchResumeBean) {
                mView.returnResumeList(searchResumeBean);
            }

            @Override
            protected void _onError(String message) {
                mView.showErrorTip(message);
            }
        }));
    }

    @Override
    public void getLoadOrRefreshData(Map<String, String> map) {
        mRxManage.add(mModel.getResumeList(map).subscribe(new RxSubscriber<SearchResumeBean>(mContext,false) {

            @Override
            protected void _onNext(SearchResumeBean searchResumeBean) {
                mView.returnLoadOrRefreshResumeList(searchResumeBean);
            }

            @Override
            protected void _onError(String message) {
                mView.showErrorTip(message);
            }
        }));
    }
}
